473,416 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Changing submit function according to what user selects in pulldown list

I have made a form at http://www.lcuk.org/cleanair/form.htm

In the Financial Information section there is a question "How do you
wish to pay?"

If the user selects "invoice" then when the user hits submit I want
the form simply to call a formmail.cgi script and email the contents
to me.

However if the user selects "credit card" then I need to pass the form
contents to a second form (http://www.lcuk.org/cleanair/form2.htm) to
be held on a secure server so that the user's credit card details can
be given. The details from the first form need to be written to the
corresponding boxes on the second form.

Is there a way to do all this?

I'm new to all this and would really appreciate some help! Please
assume I'm stupid and know nothing...
Jul 20 '05 #1
2 1470
Claire Osborne wrote:
I have made a form at http://www.lcuk.org/cleanair/form.htm

In the Financial Information section there is a question "How do you
wish to pay?"

If the user selects "invoice" then when the user hits submit I want
the form simply to call a formmail.cgi script and email the contents
to me.

However if the user selects "credit card" then I need to pass the form
contents to a second form (http://www.lcuk.org/cleanair/form2.htm) to
be held on a secure server so that the user's credit card details can
be given. The details from the first form need to be written to the
corresponding boxes on the second form.

Is there a way to do all this?

I'm new to all this and would really appreciate some help! Please
assume I'm stupid and know nothing...


Most reliable way? Submit the form to someScript.cgi and have
someScript.cgi check the payment method and redirect accordingly.

Javascript way? onSubmit, call a function that will set the forms action
property and then submit the form. Doesn't work with js disabled.

Alternative:
Use both. Set the action of the form to the someScript.cgi, and onSubmit
have JS check the payment method, and reset the forms action. Then, if
JS is disabled, the server handles it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2
In article <12**************************@posting.google.com >,
cl****@interface-web.co.uk enlightened us with...
I have made a form at http://www.lcuk.org/cleanair/form.htm


This is an internet application. Do not rely on javascript for internet
applications. You're asking for problems if you do. Not everyone has JS
enabled. What would happen to those people?

IOW, use server-side code to do this for internet applications. Have the
form submit to a page that checks which option to do, then that page
does the appropriate thing.
Most (if not all) server-side scripting languages have the ability to
forward. Edit your formmail script to forward to the other html page if
appropriate.
Check a perl group for details.
--
--
~kaeli~
The definition of a will?... (It's a dead giveaway.)
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
Hello, I'm looking for an example of doing a page with pulldown menus, where the user selects a choice from the first pulldown, then based on that input, another appears, then the user selects...
3
by: jeff | last post by:
Hello, I have a form that submits it's values to a pop-up window. I've simplied the code: <form name="formname" action="action.php" target="windowName" method="post" onsubmit="window.open('',...
1
by: Deidre | last post by:
I am having a weird problem. I have an application thats default.aspx page is a menu page when a menu item is selected the requested page is loaded into default.aspx using iframes. When unsaved...
2
by: ColinWard | last post by:
Hi. I have a form which has as its recordsource an SQL string. The SQL String is as follows: SELECT * from CONTACTS where false. this ensures that there is no data loaded in the form when the...
3
by: qwerty | last post by:
I´m new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a...
15
by: Sonnich | last post by:
Hi all! I have a file where I'd have to submit buttons, and I need to differ between those. Step #1 - open html win with default selection Step #2 - user may select some criteries for the...
4
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters...
13
Frinavale
by: Frinavale | last post by:
I've been trying all morning to cancel a form submit to the server. I have a JavaScript Object that determines whether or not the page should be submitted to the server depending on whether the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.